import axios from 'axios'

export let get_list = () => {
    return async (dispatch) => {
      let res =  await axios.get('/list')
      dispatch({
        type : 'GET_LIST',
        payload : {
          data : res.data.list,
          loading : false
        }
      })
    }
}

export let del_item = (id) => {
    return {
        type : 'DEL_ITEM',
        payload : id
    }
}

export let  set_data = (obj) => {
  return {
    type : 'SET_DATA',
    payload : obj
  }
}

export let edit_data = (obj) => {
  return {
    type : 'EDIT_DATA',
    payload : obj
  }
}

export let filter_data = (str) => {
  return {
    type : 'FILTER_DATA',
    payload : str
  }
}


export let all_Deleit = (select_data) => {
  return {
    type : 'ALL_DELETE',
    payload : select_data
  }
}


